<template>
    <div>
        <a-row>
            <a-col
                    :span="16"
            >
                <a-form-item
                        label="所属单位"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <OrgTreeSelect
                            v-model="form.projectId"
                            disabled
                            is-auto-select-first
                            @getProjectInfo="getProjectInfo"></OrgTreeSelect>
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="双优化立项编号"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.optimizationNum"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="项目业态"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="projectInfo.projectFormatName"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="项目设计管理类别"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="projectInfo.designName"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="双优化立项名称"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.optimizationName"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="分类"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.typeName"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="详细分类"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.classificationName"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="设计阶段"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.designStage"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="优化类别"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.optimizeStage"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="工程类别"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.projectType"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="分部"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.part"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="创新"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                        <a-radio-group v-model="form.isNew" disabled>
                            <a-radio  :value="1">是</a-radio>
                            <a-radio  :value="0">否</a-radio>
                        </a-radio-group>
                </a-form-item>
            </a-col>

            <a-col
                    :span="8"
            >
                <a-form-item
                        label="提出人"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.proposer"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="拟实施人"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.implementer"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>

            <a-col
                    :span="8"
            >
                <a-form-item
                        label="立项效益(万)"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.forecastBenefit"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="计划实施时间"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.startTime"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="计划结束时间"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.endTime"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="专业类别"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <a-select
                            v-model="form.majorCategory"
                            disabled
                            style="width: 100%"
                    >
                        <a-select-option :value="0">
                            建筑
                        </a-select-option>
                        <a-select-option :value="1">
                            机电
                        </a-select-option>
                        <a-select-option :value="2">
                            结构
                        </a-select-option>
                        <a-select-option :value="3">
                            市政景观
                        </a-select-option>
                    </a-select>
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="创建人"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.creater"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :span="8"
            >
                <a-form-item
                        label="创建时间"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <BaseInput
                            v-model="form.createdTime"
                            type="text"
                            disabled
                    />
                </a-form-item>
            </a-col>
            <a-col
                    :md="24"
                    :sm="24"
            >
                <a-form-item
                        label="内容概述"
                        :label-col="{ lg: { span: 7 }, sm: { span: 7 } }"
                        :wrapper-col="{ lg: { span: 17 }, sm: { span: 17 } }"
                >
                    <editor
                            v-model="form.contentDels"
                            :is-clear="true"
                            disabled
                    />
                </a-form-item>
            </a-col>
        </a-row>
    </div>
</template>

<script>
  import editor from '@/components/Editor/editor'
  export default {
    name: 'baseInfo',
    props: {
      form: {
        type: Object,
        default() {
          return {}
        }
      }
    },
    data() {
      return {
        projectInfo: {}
      }
    },
    components: {
      editor
    },
    methods: {
      getProjectInfo(info) {
        if(info.projectFormatName?.length) {
          info.projectFormatName = info.projectFormatName.join(",")
        }
        if(info.innerPackageCode === 0) {
          info.ownerValue = +info.contractValue - (info.ownerContractValue)
        } else {
          info.ownerValue = info.ownerContractValue
        }
        this.projectInfo = info
      }
    }
  }
</script>

<style scoped>

</style>